package com.king.juc.frames;

import lombok.extern.slf4j.Slf4j;

/**
 * 栈，栈帧
 *
 * @author king
 * @date 2020/9/4 13:51
 */
public class Frames {
    private static int test = 100;

    public static void main(String[] args) {
        // Debug启动, 断点续设置 Suspend 为 Thread 模式

        Thread t1 = new Thread(() -> {
            method1(20);
        }, "t1");
        t1.start();

        method1(10);
    }

    private static void method1(int x) {
        int y = x + 1;
        Object m = method2();
        System.out.println(y);
    }

    private static Object method2() {
        test += 200;
        Object n = new Object();
        return n;
    }
}
